import time

from selenium.webdriver.chrome import webdriver
from selenium.webdriver.common.by import By
from tools.doLogs import DoLog

zc = webdriver.WebDriver()
zc.get("http://192.168.88.132/user.php?act=register")
zc.implicitly_wait(10)


class RegPage():
    unameE = (By.NAME, "username")
    uemailE = (By.NAME, "email")
    upwdE = (By.NAME, "password")
    upwdE2 = (By.NAME, "confirm_password")
    uexE = (By.NAME, 'extend_field2')
    uphoneE = (By.NAME, 'extend_field5')
    regE = (By.NAME, "Submit")

    def zhuce(self, a, b, c, d, e):
        zc.find_element(*self.unameE).send_keys(a)
        zc.find_element(*self.unameE).send_keys(a)
        zc.find_element(*self.uemailE).send_keys(b)
        zc.find_element(*self.upwdE).send_keys(c)
        zc.find_element(*self.upwdE2).send_keys(c)
        zc.find_element(*self.uexE).send_keys(d)
        zc.find_element(*self.uphoneE).send_keys(e)
        zc.find_element(*self.regE).click()


if __name__ == '__main__':
    rp = RegPage()
    rp.zhuce(a='sxv', b='123456789@qq.com', c="123456", d="123789456", e="123456789")
